package com.best.onegous.fragments;


import java.util.ArrayList;
import java.util.List;

import com.best.onegous.R;
import com.best.onegous.Adapter.JieXiaoAdapter;
import com.best.onegous.Adapter.Order_leftAdapter;
import com.best.onegous.Adapter.Winning_leftAdapter;
import com.best.onegous.Refresh.XListView;
import com.best.onegous.Refresh.XListView.IXListViewListener;

import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class Winning_left extends Fragment implements IXListViewListener {
	private static Winning_left activity;
	private View mBaseView;
	private XListView mListView;
	private List<String> mDatas = new ArrayList<String>();
	private Winning_leftAdapter mAdapter;
	public static Winning_left newInstance() {
		if(null==activity){
			activity = new Winning_left();
		}
		return activity;

	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		mBaseView = inflater.inflate(R.layout.winning_left, null);
		mListView = (XListView) mBaseView.findViewById(R.id.listview);
		for(int i = 0;i<3;i++){
			mDatas.add("");
		}
		
		mAdapter = new Winning_leftAdapter(getActivity(), mDatas);
		mListView.setAdapter(mAdapter);
		mListView.setPullRefreshEnable(true);
		mListView.setPullLoadEnable(true);
		mListView.setXListViewListener(this);
		return mBaseView;
	}
	@Override
	public void onLoadMore() {
		// TODO Auto-generated method stub
		Handler handler = new Handler();
		handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				mListView.stopLoadMore();
			}
		}, 2000);
	}

	@Override
	public void onRefresh() {
		// TODO Auto-generated method stub
		Handler handler = new Handler();
		handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				mListView.stopRefresh();
			}
		}, 2000);
	}
	
}
